<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ page import="com.dimeina.vo.*" %>
<%@ page import="com.dimeina.service.*" %>
<%@ page import="com.dimeina.service.impl.*" %>
<%@ page import="com.dimeina.servlet.*" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>商品分类管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<style type="text/css">
		.gridview {
			 border: 1px solid #1E82D1;
			 border-collapse: collapse;
			 width: 100%;
			 font-size:12pt;
		}
		
		
		.gridview td {
			height:28px;
			border: 1px solid #1E82D1;
			text-align: center;
		}
		
	</style>

  </head>
  
  <body>
  	<table class="gridview">
  		<%
  			CategoryService categoryServiceImpl = new CategoryServiceImpl();
  			List<Category> topList = categoryServiceImpl.findCategoryByDepth(1);
  			List<Category> secondList = categoryServiceImpl.findCategoryByDepth(2);
  			List<Category> threeList = categoryServiceImpl.findCategoryByDepth(3);
  		%>
     <tr>
  	    <td style="color:red;font-size:18px">1级分类</td>
  	 </tr>
  	 <tr>
  	    <%for(Category category : topList){ %>
  	    <td><%=category.getName() %></td>
  	    <%} %>
  	 </tr>
  	 
  	 <tr>
  	    <td style="color:red;font-size:18px">2级分类</td>
  	 </tr>
     <tr>
  	    <%for(Category category : secondList){ %>
  	    <td><%=category.getName() %></td>
  	    <%} %>
  	 </tr>  
  	 
  	 <tr>
  	    <td style="color:red;font-size:18px">3级分类</td>
  	 </tr>
     <tr>
  	    <%for(int i=0; i<8; i++){ %>
  	    <td><%=threeList.get(i).getName() %></td>
  	    <%} %>
  	 </tr>
  	 <tr>
  	    <%for(int i=8; i<16; i++){ %>
  	    <td><%=threeList.get(i).getName() %></td>
  	    <%} %>
  	 </tr>
  	 <tr>
  	    <%for(int i=16; i<24; i++){ %>
  	    <td><%=threeList.get(i).getName() %></td>
  	    <%} %>
  	 </tr>
  	 <tr>
  	    <%for(int i=24; i<threeList.size(); i++){ %>
  	    <td><%=threeList.get(i).getName() %></td>
  	    <%} %>
  	 </tr>

  	</table>
  </body>
</html>
